//
//  TMGHelpTableViewCell.m
//  TMGold
//
//  Created by Mac on 2017/12/11.
//  Copyright © 2017年 tangmu. All rights reserved.
//

#import "TMGKnowNewsTableViewCell.h"
@interface  TMGKnowNewsTableViewCell()
@property(nonatomic, strong) STLabel                     *titleLabel;
@property(nonatomic, strong) STLabel                     *typeLabel;
@property(nonatomic, strong) STLabel                     *timeLabel;
@property(nonatomic, strong) UIImageView                 *iconIamgeView;

@end

@implementation TMGKnowNewsTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 100;
}
#pragma mark --subView
- (void)configSubView{
    self.backgroundColor = [UIColor whiteColor];
    
    self.iconIamgeView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 70, 70)];
    self.iconIamgeView.image = [UIImage imageNamed:@"13"];
    self.iconIamgeView.right = UIScreenWidth - 15;
    self.iconIamgeView.centerY = [TMGKnowNewsTableViewCell cellHeight] /2 ;
    [self addSubview:self.iconIamgeView];
    
    
    self.titleLabel = [[STLabel alloc] initWithFrame:CGRectMake(15, self.iconIamgeView.top , self.iconIamgeView.left - 10 - 15, 40)
                                                    text:@"大陆十大健康老师打开了手机阿基里斯大了阿萨德阿德奥术大师多"
                                               textColor:TM_firstTextColor
                                                    font:15
                                             isSizetoFit:NO
                                           textAlignment:NSTextAlignmentLeft];
    self.titleLabel.numberOfLines = 0;
    [self addSubview:self.titleLabel];
    

    
    self.typeLabel = [[STLabel alloc] initWithFrame:CGRectMake(self.titleLabel.left, self.titleLabel.bottom + 5 , 200, 30)
                                                    text:@"媒体分析"
                                               textColor:TM_secendTextColor
                                                    font:14
                                             isSizetoFit:NO
                                           textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.typeLabel];
    

    
    self.timeLabel = [[STLabel alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom + 5, UIScreenWidth / 2, 30)
                                                    text:@"2017年12月13日10:51:46"
                                               textColor:TM_secendTextColor
                                                    font:14
                                             isSizetoFit:NO
                                           textAlignment:NSTextAlignmentRight];
    self.timeLabel.right = self.titleLabel.right;
    [self addSubview:self.timeLabel];
    

}
- (void)setModel:(TMGNewsModel *)model{
    _model = model;
    self.timeLabel.text = model.create_at;
    self.typeLabel.text = model.author;
    self.titleLabel.text = model.title;
    [self.iconIamgeView sd_setImageWithURL:[NSURL URLWithString:model.image] completed:nil];
}
@end





